package org.dubbo.demo.consumer;

import org.dubbo.demo.api.DemoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;

@RestController
public class DemoConsumerController {
	
	@Reference(version = "1.0.0",
            application = "${dubbo.application.id}")
    private DemoService demoService;

    @RequestMapping("/")
    @ResponseBody
    public String sayHello(@RequestParam String name) {
        return demoService.sayHello(name);
    }
}
